<?php

class Application_Form_Register extends Zend_Form
{
	public function __construct($action=null){
		parent::__construct();
		$this->setAction($action);
	}
	
    public function init()
    {
        $this->setMethod('post');
        
        $userEl = new Zend_Form_Element_Text('name');
        $userEl->setLabel('Enter username')
        		->setOptions(array('size' => 25))
        		->setRequired(true)
        		->addFilter('StripTags')
        		->addFilter('StringTrim')
        		->addValidator('Alnum'/*, true, array('allowWhiteSpace' => true)*/);
       	
        $emailEl = new Zend_Form_Element_Text('email');
        $emailEl->setLabel('Enter your email address')
        		->setOptions(array('size' => 25))
        		->setRequired(true)
        		->addFilter('StripTags')
        		->addFilter('StringTrim')
        		->addValidator('EmailAddress');
        		
        $passEl = new Zend_Form_Element_Password('password');
        $passEl->setLabel('Enter password')
        		->setOptions(array('size' => 25))
        		->setRequired(true)
        		->addFilter('StringTrim');
        		
        $passConfEl = new Zend_Form_Element_Password('passwordConf');
        $passConfEl->setLabel('Confirm password')
        		->setOptions(array('size' => 25))
        		->setRequired(true)
        		->addFilter('StringTrim');
        		
        		
        $submitEl = new Zend_Form_Element_Submit('submit');
        $submitEl->setLabel('Register');

        $this->addElements(array($userEl, $emailEl, $passEl, $passConfEl, $submitEl));
    }


}

